<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>
			小凡凡
		</title>
		<script src="../js/global.js"></script>
	</head>
	<body style="height:1150px;">
	<div class="container-fluid ygyd-wrapper">
	
	    <!--相关统计-->
	    <div class="row">
	        <div class="col-sm-12">
	            <section class="panel">
	                <div class="panel-heading">按咨询师统计学生数量</div>
	                <div class="panel-body">
	                    <div class="echarts" id="area" style="height:300px; height:350px"></div>
	                </div>
	            </section>
	        </div>
	
	
	
	    </div>
	</div>
	<script src="./layui/layui.js" charset="utf-8"></script>
	<script src="../lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
	<script src="./js/echarts.min.js"></script>
	<script src="./js/echart.js"></script>
	
	<script type="text/javascript">
	    // 指定图表的配置项和数据
	    var myChart = echarts.init(document.getElementById('area'));
	    myChart.showLoading();
	    $.ajax({
	        type: 'get',
	        url: globalData.server+'students/askerStudentCountReport',
			headers:{token:globalData.token},
	        dataType: 'json',
	        success: function(res) {
	            myChart.hideLoading();
	            var option = {
	                title: {
	                    text: '学生统计',
	                    subtext: '按咨询师',
	                    x: 'center'
	                },
	                tooltip: {
	                    trigger: 'item',
	                    formatter: "{a} <br/>{b} : {c} ({d}%)"
	                },
	                // legend: {
	                //     orient: 'vertical',
	                //     left: 'left',
	                //     data: res.name
	                // },
	                series: [{
	                    name: '学生数量',
	                    type: 'pie',
	                    radius: '55%',
	                    center: ['50%', '60%'],
	                    data: res,
	                    itemStyle: {
	                        emphasis: {
	                            shadowBlur: 10,
	                            shadowOffsetX: 0,
	                            shadowColor: 'rgba(0, 0, 0, 0.5)'
	                        }
	                    }
	                }]
	            };
	            // 使用刚指定的配置项和数据显示图表。
	            myChart.setOption(option);
	        },
	        error: function() {
	            alert("获取失败！！！")
	        }
	    });
	
	
	    // 指定图表的配置项和数据
	
	
	</script>
	
	
	</body>
	</html>